﻿'Server-side setttings: validate requested encryption
Public Interface IConfig_Server : Inherits IConfig
    ReadOnly Property RequireEncryption As Boolean 'Optional, defaults to false
    ReadOnly Property RequireEncryptionKey As String
    Function WriteConfigSetting_RequireEncryption(value As Boolean, overwrite As Boolean) As Boolean
End Interface

'Client-side setttings: preconfigure choice of encryption
Public Interface IConfig_Client : Inherits IConfig
    ReadOnly Property Encryption As EEncryption 'Optional, defaults to none
    ReadOnly Property HostName As String 'Optional, can provide to constructor
    ReadOnly Property UseSsl As Boolean
    ReadOnly Property Endpoint As String 'Optional, can provide to constructor (wcf-only, needed in addition to HostName)
    ReadOnly Property Transport As ETransport 'Optional, defaults to REST, only used by Factory methods

    Function WriteConfigSetting_HostName(value As String, overwrite As Boolean) As Boolean
    Function WriteConfigSetting_Encryption(value As EEncryption, overwrite As Boolean) As Boolean
    Function WriteConfigSetting_Transport(value As ETransport, overwrite As Boolean) As Boolean
    Function WriteConfigSetting_UseSsl(value As Boolean, overwrite As Boolean) As Boolean
End Interface

'Common settings: Password is stored in config file, ideally in the encrypted section (defaults to Framework.WebservicePassword), and used to provide encryption
Public Interface IConfig
    ReadOnly Property Password As String
    Function WriteConfigSetting_Password(value As String, overwrite As Boolean) As Boolean

    Function Encrypt(data As Byte(), algorithm As EEncryption) As Byte() 'Password involved (from config)
    Function Decrypt(data As Byte(), algorithm As EEncryption) As Byte() 'Password involved (from config)
End Interface


Public Enum ETransport
    Rest
    WCF
    CmdLineExe
    InProcess
End Enum